package ch.zbw.pra.sysventory.test.domain.network;

import org.junit.Before;
import org.junit.Test;

import ch.zbw.pra.sysventory.network.server.TCPServer;

public class StartServer {

	private TCPServer tcpServer;

	@Before
	public void setup() {
		this.tcpServer = new TCPServer(7777, null);
		new Thread(this.tcpServer).start();
		try {
			Thread.sleep(5 * 1000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		this.tcpServer.setScanning(true);

		try {
			Thread.sleep(400 * 1000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		this.tcpServer.stop();

	}

	@Test
	public void tearDown() {
		this.tcpServer.stop();

	}

}
